package com.example.calendarapp;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Locale;

public class FormatDate {

	public static String convertWeekDays(String date) {
		String finalDate = null;
		try {
			SimpleDateFormat oldFormat = new SimpleDateFormat(
					"yyyy-MM-dd", Locale.ENGLISH);
			SimpleDateFormat newFormat = new SimpleDateFormat("dd");
			Date i = oldFormat.parse(date);
			finalDate = newFormat.format(i);
		} catch (Exception e) {
			e.printStackTrace();
		}

		return finalDate;

	}

	
	
	public static String convertDate(String date)
	{
		String finalDate = null;
		try
			{
				SimpleDateFormat oldFormat = new SimpleDateFormat("yyyy-MM-dd" , Locale.ENGLISH);
				SimpleDateFormat newFormat = new SimpleDateFormat("MMMM yyyy");
				Date i = oldFormat.parse(date);
				finalDate = newFormat.format(i);
			} catch (Exception e)
			{
				e.printStackTrace();
			}

		return finalDate;

	}

}